<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        setTimeout(function () {
            var a = 'hello '
            setTimeout(function () {
                var b = 'lagou '
                setTimeout(function() {
                    var c = 'I ❤ U'
                    console.log(a + b + c)
                }, 10)
            }, 10)
        }, 10)

        const p1 = new Promise((reslve) => reslve('hello '))
        const p2 = new Promise((reslve) => reslve('lagou '))
        const p3 = new Promise((reslve) => reslve('I ❤ U'))

        const curry = fn => curriedFn = (...args) => args.length < fn.length ? (...rest) => curriedFn(...args.concat(rest)) : fn(...args)

        async function hello1(p1, p2, p3) {
            let a = await p1
            let b = await p2
            let c = await p3
            return a + b + c
        }
        
        const curryHello = curry(hello1)

        curryHello(p1)(p2)(p3).then((res) => {
            console.log(res)
        })


    </script>
</body>
</html>